/*
* Author: honrun
*/
#ifndef DEVICESUART_H_
#define DEVICESUART_H_

#include "esp_intr_alloc.h"
#include "soc/interrupts.h"
#include "soc/uart_periph.h"
#include "driver/gpio.h"
#include "driver/uart.h"
#include "hal/uart_hal.h"
#include "hal/uart_ll.h"


void vUart0Init(void);
void vUart1Init(void);

void vUartBaudrateSet(uart_dev_t *uart, int32_t iBaudrate);

void vUartSendDatas(uart_dev_t *uart, void *pvDatas, int32_t iLength);
void vUartSendStrings(uart_dev_t *uart, char *pcStrings);

int8_t cUartReceiveByte(uart_dev_t *uart, uint8_t *pucByte);
int8_t cUartReceiveDatas(uart_dev_t *uart, void *pvDatas, int32_t iLength);
int32_t iUartReceiveAllDatas(uart_dev_t *uart, void *pvDatas, int32_t iLengthLimit);
int32_t iUartReceiveLengthGet(uart_dev_t *uart);
int8_t cUartReceiveClear(uart_dev_t *uart);


#endif /* DEVICESUART_H_ */
